package com.chen.springcloud.demo.controller;

import com.chen.springcloud.demo.client.remote.UAAClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author chentian
 * @date 2021/12/25
 */
@Slf4j
@RestController
@RequestMapping("/api/feign/call/uaa")
public class UaaFeignCallController {

    @Resource
    private UAAClient uaaClient;

    @GetMapping("/hello/v1")
    public String hello(){
        String res = uaaClient.hello();
        log.info("res:"+res);
        return res;
    }

    @GetMapping("/hello/word/{word}/v1")
    public String word(@PathVariable String word){
        log.info("word:"+word);
        String res = uaaClient.word(word);
        log.info("res:"+res);
        return res;
    }
}
